package springcloud.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.buba.springcloud.pojo.Document;
import com.buba.springcloud.pojo.ProvinceData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import springcloud.mapper.DataMapper;
import springcloud.service.IDataService;


@Slf4j
@Service
public class DataServiceImpl  extends ServiceImpl<DataMapper, ProvinceData> implements IDataService {

    @Override
    public ProvinceData selectByName(String name) {

        QueryWrapper<ProvinceData> lqw = new QueryWrapper<ProvinceData>();
        lqw.eq("name", name).orderByDesc("id").last("limit 1");

        return super.getOne(lqw);
    }
}
